BIN = code
SRC = $(wildcard *.c)
#OBJ = $(SRC: .c=.o)
OBJ = $(SRC:.c=.o)
CC = gcc -g
CFLAGE = -o
RM = rm 

$(BIN) : $(OBJ)
	@$(CC) $(CFLAGE) $(@) $(^)
	@echo "linking.."
%.o : %.c
	@$(CC) -c $(<)
	@echo "compelling $(<) to $(@)..."
.PHONY:clean
clean:
	@$(RM) $(OBJ) $(BIN)
	@echo "cleaning..."		


# BIN=code
# OBJ=test.o
# SOU=test.c
# CC = gcc
# FLAG = -o
# RM = rm -f

# $(BIN) : $(OBJ)
# 	$(CC) -o $@ $^
# $(OBJ) : $(SOU) 
# 	$(CC) -c $^

# .PHONY : 
# clean:
# 	$(RM) $(OBJ) $(BIN)







# code : test.o
# 	#gcc -o code test.o
# test.s : test.i
# 	gcc -S test.i
# test.i : test.c
# 	gcc -E test.c

